<template>
    <div class="v-warp">
          <van-swipe class="v-swipe" :autoplay="3000">
              <van-swipe-item v-for="(banner, index) in bannerData" :key="index">
                    <div class="v-swipe-item">
                      <a :href="'#/detail/'+banner.vid">
                          <img v-lazy="banner.pic" />
                          <span>{{banner.vname}}</span>
                      </a>
                    </div>
              </van-swipe-item>
      </van-swipe>
      <div v-for="ditem in dataItem">
        <h2 class="v-title">{{ditem.name}} <i class="iconfont inext"></i></h2>
        <van-row gutter="10" class="scroll-wrapper">
            <van-col span="8" class="v-item scroll-item" v-for="item in ditem.dataList">
                   <a :href="'#/detail/'+item.vid">
                      <div class="v-item-imghd">
                        <img v-lazy="item.vpic" />
                        <span class="v-item-imghd-hot">{{item.vnote}}</span>
                      </div>
                      <h2>{{item.vname}}</h2>
                      <p>{{item.vpublishyear +'/'}}{{item.vpublisharea+'/'}}{{item.tnamel2}}</p>
                   </a>
                </van-col>
        </van-row>
        </div>
    </div>
</template>
<script>
import vscroll from '../libs/vscroll';
export default {
  name: "homeitembody",
  components: {
  },
  props: {
    tid: String
  },
  data() {
    return {
      tabbarActive:0,
      bannerData: [],
      dataItem:[],
    };
  },
  methods:{
  },
  mounted() {
    let that = this;
    that.$ajax.get(that.$api.spic + that.tid, {}, successRes => {
      that.bannerData = successRes.data;
    });
      
    that.$ajax.get(that.$api.item + that.tid, {}, successRes => {
      that.dataItem = successRes.data;
      setTimeout(() => {
        vscroll.init();
      }, 1000);
    });

  }
};
</script>
<style lang="less" >
</style>
